#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;


int main()
{
    int n{0}, num{0}, tmp{0}, max_i{0}, min_i{0};
    vector<int> v;
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        max_i = 0;
        v.clear();  // 注意有重复运行的，需要将数据清空
        cin >> num;
        for(int j = 0; j < num; j++)
        {
            cin >> tmp;
            v.push_back(tmp);
        }
        for(int j = 1; j < num; j++)
        {
            v[j] = (v[j-1] > 0)?(v[j]+v[j-1]):(v[j]);
        }
        for(int j = 1; j < num; j++)
        {   
            if(v[j] > v[max_i]) max_i = j;
        }
        min_i = max_i - 1;
        while(min_i >= 0 && v[min_i] >= 0) min_i--;
        min_i++;
        cout << "Case " << i << ":" << endl;
        cout << v[max_i] << " " << min_i+1 << " " << max_i+1 << endl;
        if(i != n) cout << endl;
    }
    return 0;
}


